<?php

/**
 * TypeJour form base class.
 *
 * @method TypeJour getObject() Returns the current form's model object
 *
 * @package    sop
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTypeJourForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'libelle'               => new sfWidgetFormInputText(),
      'default_duree'         => new sfWidgetFormInputText(),
      'is_oblig_duree'        => new sfWidgetFormInputText(),
      'is_default_jour_ouvre' => new sfWidgetFormInputText(),
      'is_default_we'         => new sfWidgetFormInputText(),
      'is_only_duree'         => new sfWidgetFormInputText(),
      'is_credit'             => new sfWidgetFormInputText(),
      'is_deplact'            => new sfWidgetFormInputText(),
      'id'                    => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'libelle'               => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'default_duree'         => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_oblig_duree'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_default_jour_ouvre' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_default_we'         => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_only_duree'         => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_credit'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'is_deplact'            => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('type_jour[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TypeJour';
  }


}
